<!-- Popup.vue -->
<template>
    <div v-if="visible" class="popup-overlay">
        <div class="popup-content">
            <slot name="header"></slot>
            <br>
            <slot name="content"></slot>
            <br>
            <slot name="footer"></slot>
            <button @click="close">关闭</button>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        visible: {
            type: Boolean,
            required: true
        }
    },
    methods: {
        close() {
            this.$emit('close');
        }
    }
};
</script>

<style scoped>
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}
</style>